﻿/*
 * XCoder v3.4.2011.0316
 * 作者：nnhy/X
 * 时间：2011-04-04 11:54:06
 * 版权：版权所有 (C) 新生命开发团队 2010
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using XCode;
using XCode.DataAccessLayer;

namespace NXCMS.CMS
{
	/// <summary>
	/// 自定义表
	/// </summary>
	[Serializable]
	[DataObject]
	[Description("自定义表")]
	[BindTable("CustomTable", Description = "自定义表", ConnName = "CMS", DbType = DatabaseType.SqlServer)]
	public partial class CustomTable
	{
		#region 属性
		private Int32 _ID;
		/// <summary>
		/// 编号
		/// </summary>
		[Description("编号")]
		[DataObjectField(true, true, false, 10)]
		[BindColumn(1, "ID", "编号", "", "int", 10, 0, false)]
		public Int32 ID
		{
			get { return _ID; }
			set { if (OnPropertyChange("ID", value)) _ID = value; }
		}

		private Int32 _SiteID;
		/// <summary>
		/// 站点编号
		/// </summary>
		[Description("站点编号")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(2, "SiteID", "站点编号", "", "int", 10, 0, false)]
		public Int32 SiteID
		{
			get { return _SiteID; }
			set { if (OnPropertyChange("SiteID", value)) _SiteID = value; }
		}

		private String _Code;
		/// <summary>
		/// 代码
		/// </summary>
		[Description("代码")]
		[DataObjectField(false, false, false, 50)]
		[BindColumn(3, "Code", "代码", "", "nvarchar(50)", 0, 0, true)]
		public String Code
		{
			get { return _Code; }
			set { if (OnPropertyChange("Code", value)) _Code = value; }
		}

		private String _Name;
		/// <summary>
		/// 名称
		/// </summary>
		[Description("名称")]
		[DataObjectField(false, false, false, 100)]
		[BindColumn(4, "Name", "名称", "", "nvarchar(100)", 0, 0, true)]
		public String Name
		{
			get { return _Name; }
			set { if (OnPropertyChange("Name", value)) _Name = value; }
		}

		private String _Type;
		/// <summary>
		/// 类型
		/// </summary>
		[Description("类型")]
		[DataObjectField(false, false, false, 10)]
		[BindColumn(5, "Type", "类型", "", "nvarchar(10)", 0, 0, true)]
		public String Type
		{
			get { return _Type; }
			set { if (OnPropertyChange("Type", value)) _Type = value; }
		}

		private Int32 _DatabaseID;
		/// <summary>
		/// 数据库编号
		/// </summary>
		[Description("数据库编号")]
		[DataObjectField(false, false, true, 10)]
		[BindColumn(6, "DatabaseID", "数据库编号", "", "int", 10, 0, false)]
		public Int32 DatabaseID
		{
			get { return _DatabaseID; }
			set { if (OnPropertyChange("DatabaseID", value)) _DatabaseID = value; }
		}

		private String _OldCode;
		/// <summary>
		/// 
		/// </summary>
		[Description("")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(7, "OldCode", "", "", "nvarchar(50)", 0, 0, true)]
		public String OldCode
		{
			get { return _OldCode; }
			set { if (OnPropertyChange("OldCode", value)) _OldCode = value; }
		}

		private String _FormContent;
		/// <summary>
		/// 表单内容
		/// </summary>
		[Description("表单内容")]
		[DataObjectField(false, false, true, 1073741823)]
		[BindColumn(8, "FormContent", "表单内容", "", "ntext", 0, 0, true)]
		public String FormContent
		{
			get { return _FormContent; }
			set { if (OnPropertyChange("FormContent", value)) _FormContent = value; }
		}

		private String _Memo;
		/// <summary>
		/// 注释
		/// </summary>
		[Description("注释")]
		[DataObjectField(false, false, true, 100)]
		[BindColumn(9, "Memo", "注释", "", "nvarchar(100)", 0, 0, true)]
		public String Memo
		{
			get { return _Memo; }
			set { if (OnPropertyChange("Memo", value)) _Memo = value; }
		}

		private Boolean _AllowView;
		/// <summary>
		/// 允许视图
		/// </summary>
		[Description("允许视图")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(10, "AllowView", "允许视图", "", "bit", 0, 0, false)]
		public Boolean AllowView
		{
			get { return _AllowView; }
			set { if (OnPropertyChange("AllowView", value)) _AllowView = value; }
		}

		private Boolean _AllowModify;
		/// <summary>
		/// 允许修改
		/// </summary>
		[Description("允许修改")]
		[DataObjectField(false, false, false, 1)]
		[BindColumn(11, "AllowModify", "允许修改", "", "bit", 0, 0, false)]
		public Boolean AllowModify
		{
			get { return _AllowModify; }
			set { if (OnPropertyChange("AllowModify", value)) _AllowModify = value; }
		}

		private String _Prop1;
		/// <summary>
		/// 属性1
		/// </summary>
		[Description("属性1")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(12, "Prop1", "属性1", "", "nvarchar(50)", 0, 0, true)]
		public String Prop1
		{
			get { return _Prop1; }
			set { if (OnPropertyChange("Prop1", value)) _Prop1 = value; }
		}

		private String _Prop2;
		/// <summary>
		/// 属性2
		/// </summary>
		[Description("属性2")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(13, "Prop2", "属性2", "", "nvarchar(50)", 0, 0, true)]
		public String Prop2
		{
			get { return _Prop2; }
			set { if (OnPropertyChange("Prop2", value)) _Prop2 = value; }
		}

		private String _AddUser;
		/// <summary>
		/// 添加用户
		/// </summary>
		[Description("添加用户")]
		[DataObjectField(false, false, false, 200)]
		[BindColumn(14, "AddUser", "添加用户", "", "nvarchar(200)", 0, 0, true)]
		public String AddUser
		{
			get { return _AddUser; }
			set { if (OnPropertyChange("AddUser", value)) _AddUser = value; }
		}

		private DateTime _AddTime;
		/// <summary>
		/// 添加时间
		/// </summary>
		[Description("添加时间")]
		[DataObjectField(false, false, false, 7)]
		[BindColumn(15, "AddTime", "添加时间", "", "datetime2", 7, 0, false)]
		public DateTime AddTime
		{
			get { return _AddTime; }
			set { if (OnPropertyChange("AddTime", value)) _AddTime = value; }
		}

		private String _ModifyUser;
		/// <summary>
		/// 修改用户
		/// </summary>
		[Description("修改用户")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(16, "ModifyUser", "修改用户", "", "nvarchar(200)", 0, 0, true)]
		public String ModifyUser
		{
			get { return _ModifyUser; }
			set { if (OnPropertyChange("ModifyUser", value)) _ModifyUser = value; }
		}

		private DateTime _ModifyTime;
		/// <summary>
		/// 修改时间
		/// </summary>
		[Description("修改时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(17, "ModifyTime", "修改时间", "", "datetime2", 7, 0, false)]
		public DateTime ModifyTime
		{
			get { return _ModifyTime; }
			set { if (OnPropertyChange("ModifyTime", value)) _ModifyTime = value; }
		}

		private String _BackupNo;
		/// <summary>
		/// 备份编号
		/// </summary>
		[Description("备份编号")]
		[DataObjectField(false, false, true, 15)]
		[BindColumn(18, "BackupNo", "备份编号", "", "nvarchar(15)", 0, 0, true)]
		public String BackupNo
		{
			get { return _BackupNo; }
			set { if (OnPropertyChange("BackupNo", value)) _BackupNo = value; }
		}

		private String _BackupOperator;
		/// <summary>
		/// 备份操作者
		/// </summary>
		[Description("备份操作者")]
		[DataObjectField(false, false, true, 200)]
		[BindColumn(19, "BackupOperator", "备份操作者", "", "nvarchar(200)", 0, 0, true)]
		public String BackupOperator
		{
			get { return _BackupOperator; }
			set { if (OnPropertyChange("BackupOperator", value)) _BackupOperator = value; }
		}

		private DateTime _BackupTime;
		/// <summary>
		/// 备份时间
		/// </summary>
		[Description("备份时间")]
		[DataObjectField(false, false, true, 7)]
		[BindColumn(20, "BackupTime", "备份时间", "", "datetime2", 7, 0, false)]
		public DateTime BackupTime
		{
			get { return _BackupTime; }
			set { if (OnPropertyChange("BackupTime", value)) _BackupTime = value; }
		}

		private String _BackupMemo;
		/// <summary>
		/// 备份注释
		/// </summary>
		[Description("备份注释")]
		[DataObjectField(false, false, true, 50)]
		[BindColumn(21, "BackupMemo", "备份注释", "", "nvarchar(50)", 0, 0, true)]
		public String BackupMemo
		{
			get { return _BackupMemo; }
			set { if (OnPropertyChange("BackupMemo", value)) _BackupMemo = value; }
		}
		#endregion

		#region 获取/设置 字段值
		/// <summary>
		/// 获取/设置 字段值。
		/// 一个索引，基类使用反射实现。
		/// 派生实体类可重写该索引，以避免反射带来的性能损耗
		/// </summary>
		/// <param name="name">字段名</param>
		/// <returns></returns>
		public override Object this[String name]
		{
			get
			{
				switch (name)
				{
					case "ID" : return _ID;
					case "SiteID" : return _SiteID;
					case "Code" : return _Code;
					case "Name" : return _Name;
					case "Type" : return _Type;
					case "DatabaseID" : return _DatabaseID;
					case "OldCode" : return _OldCode;
					case "FormContent" : return _FormContent;
					case "Memo" : return _Memo;
					case "AllowView" : return _AllowView;
					case "AllowModify" : return _AllowModify;
					case "Prop1" : return _Prop1;
					case "Prop2" : return _Prop2;
					case "AddUser" : return _AddUser;
					case "AddTime" : return _AddTime;
					case "ModifyUser" : return _ModifyUser;
					case "ModifyTime" : return _ModifyTime;
					case "BackupNo" : return _BackupNo;
					case "BackupOperator" : return _BackupOperator;
					case "BackupTime" : return _BackupTime;
					case "BackupMemo" : return _BackupMemo;
					default: return base[name];
				}
			}
			set
			{
				switch (name)
				{
					case "ID" : _ID = Convert.ToInt32(value); break;
					case "SiteID" : _SiteID = Convert.ToInt32(value); break;
					case "Code" : _Code = Convert.ToString(value); break;
					case "Name" : _Name = Convert.ToString(value); break;
					case "Type" : _Type = Convert.ToString(value); break;
					case "DatabaseID" : _DatabaseID = Convert.ToInt32(value); break;
					case "OldCode" : _OldCode = Convert.ToString(value); break;
					case "FormContent" : _FormContent = Convert.ToString(value); break;
					case "Memo" : _Memo = Convert.ToString(value); break;
					case "AllowView" : _AllowView = Convert.ToBoolean(value); break;
					case "AllowModify" : _AllowModify = Convert.ToBoolean(value); break;
					case "Prop1" : _Prop1 = Convert.ToString(value); break;
					case "Prop2" : _Prop2 = Convert.ToString(value); break;
					case "AddUser" : _AddUser = Convert.ToString(value); break;
					case "AddTime" : _AddTime = Convert.ToDateTime(value); break;
					case "ModifyUser" : _ModifyUser = Convert.ToString(value); break;
					case "ModifyTime" : _ModifyTime = Convert.ToDateTime(value); break;
					case "BackupNo" : _BackupNo = Convert.ToString(value); break;
					case "BackupOperator" : _BackupOperator = Convert.ToString(value); break;
					case "BackupTime" : _BackupTime = Convert.ToDateTime(value); break;
					case "BackupMemo" : _BackupMemo = Convert.ToString(value); break;
					default: base[name] = value; break;
				}
			}
		}
		#endregion

		#region 字段名
		/// <summary>
		/// 取得自定义表字段名的快捷方式
		/// </summary>
		public class _
		{
			///<summary>
			/// 编号
			///</summary>
			public const String ID = "ID";

			///<summary>
			/// 站点编号
			///</summary>
			public const String SiteID = "SiteID";

			///<summary>
			/// 代码
			///</summary>
			public const String Code = "Code";

			///<summary>
			/// 名称
			///</summary>
			public const String Name = "Name";

			///<summary>
			/// 类型
			///</summary>
			public const String Type = "Type";

			///<summary>
			/// 数据库编号
			///</summary>
			public const String DatabaseID = "DatabaseID";

			///<summary>
			/// 
			///</summary>
			public const String OldCode = "OldCode";

			///<summary>
			/// 表单内容
			///</summary>
			public const String FormContent = "FormContent";

			///<summary>
			/// 注释
			///</summary>
			public const String Memo = "Memo";

			///<summary>
			/// 允许视图
			///</summary>
			public const String AllowView = "AllowView";

			///<summary>
			/// 允许修改
			///</summary>
			public const String AllowModify = "AllowModify";

			///<summary>
			/// 属性1
			///</summary>
			public const String Prop1 = "Prop1";

			///<summary>
			/// 属性2
			///</summary>
			public const String Prop2 = "Prop2";

			///<summary>
			/// 添加用户
			///</summary>
			public const String AddUser = "AddUser";

			///<summary>
			/// 添加时间
			///</summary>
			public const String AddTime = "AddTime";

			///<summary>
			/// 修改用户
			///</summary>
			public const String ModifyUser = "ModifyUser";

			///<summary>
			/// 修改时间
			///</summary>
			public const String ModifyTime = "ModifyTime";

			///<summary>
			/// 备份编号
			///</summary>
			public const String BackupNo = "BackupNo";

			///<summary>
			/// 备份操作者
			///</summary>
			public const String BackupOperator = "BackupOperator";

			///<summary>
			/// 备份时间
			///</summary>
			public const String BackupTime = "BackupTime";

			///<summary>
			/// 备份注释
			///</summary>
			public const String BackupMemo = "BackupMemo";
		}
		#endregion
	}
}